package com.dcbeida.model;

import com.dcbeida.MyApplication;
import com.dcbeida.utils.GenApiHashUrl;
import com.dcbeida.utils.JsonGet;

import dc.medicine.com.okhttplib.OkHttpUtils;
import dc.medicine.com.okhttplib.callback.AbsCallback;

/**
 * Created by hp on 2016/7/27.
 */
public class ChangePsModel {

    private static ChangePsModel mLoginModel;
    private ChangePsModel(){

    }

    public static ChangePsModel newInstance() {
        if(mLoginModel==null){
            return new ChangePsModel();
        }else {
            return mLoginModel;
        }
    }

   public  void getDate(String oldpassword,String password,AbsCallback mAbsCallback){
       OkHttpUtils.getInstance().post(GenApiHashUrl.apiUrl).tag(this)
               .paramsApp("service","updatepwd")
               .paramsApp("params",new JsonGet().putopt("uid", MyApplication.user.getUid())
                       .putopt("oldpassword",oldpassword)
                       .putopt("password",password)
                       .tostring()).execute(mAbsCallback);
   }

    public  void getCancel(){
        OkHttpUtils.getInstance().cancelTag(this);
    }
}
